{% import _self as self %}
{# Looks mismatched because this is a continuation of GlobalHeader.twig #}
                </main>
            </div> {# /#wrapper #}
            <footer>
                &copy; {{ "now"|date("Y") }}
                <a href="https://submitty.org" target="_blank" class="black-btn">Submitty</a>
                <a href="https://github.com/Submitty/Submitty/releases/tag/{{ latest_tag }}" target="_blank" title = "{{ latest_tag }} {{ latest_commit }}" class="black-btn">{{ latest_tag }}</a>
                <span class="footer-separator">|</span> <a href="https://github.com/Submitty/Submitty" target="_blank" title="Visit our GitHub" aria-label="Visit our GitHub" class="black-btn"><i class="fab fa-github fa-lg"></i></a>
                <span class="footer-separator">|</span> <a href="https://rcos.io" target="_blank" class="black-btn">An RCOS project</a>

                {% for link in footer_links %}
                    <span class="footer-separator">|</span>
                    {% if link['icon'] is defined %}
                        <i class="footer-link-icon fa fa-lg {{ link['icon'] }}"></i>
                    {% endif %}
                    <a href="{{ link['url'] }}" target="_blank" class="black-btn">{{ link['title'] }}</a>
                {% endfor %}

                {% if is_debug %}
                    <span class="footer-separator">|</span>
                    <a href="#" onClick="togglePageDetails();" class="black-btn">Show Page Details</a>
                {% endif %}
            </footer>
        </div> {# /#submitty-body #}
        {% if wrapper_urls['right_sidebar.html'] != null %}
            {# uploaded homepage redirect can go here? #}
            <iframe sandbox="allow-top-navigation-by-user-activation allow-top-navigation" id="right_sidebar" src="{{ wrapper_urls['right_sidebar.html'] }}" frameborder="0"></iframe>
        {% endif %}
    {% if wrapper_urls['bottom_bar.html'] != null %}
        {# uploaded homepage redirect can go here? #}
        <iframe sandbox="allow-top-navigation-by-user-activation allow-top-navigation" id="bottom_bar" src="{{ wrapper_urls['bottom_bar.html'] }}" frameborder="0"></iframe>
    {% endif %}
{% if is_debug %}
    <div id='page-info'>
        Runtime: {{ runtime }}<br /><br />
        <h3>Site Details</h3>
        Total Submitty Details: {{ submitty_queries|length }}<br /><br />
        Submitty Queries:<br /> {{ self.query_list(submitty_queries) }}

        <h3>Course Details</h3>
        Total Course Queries: {{ course_queries|length }}<br /><br />
        Course Queries: <br /> {{ self.query_list(course_queries) }}
    </div>
{% endif %}
</body>
</html>

{% macro query_list(queries) %}
    {# This is a data table #}
    <table>
        <caption />
        <thead>
            <tr>
                <th class="query-list">Index</th>
                <th>Queries</th>
            </tr>
        </thead>
        <tbody>
            {% for query in queries %}
                <tr>
                    <td class="index">
                        {{ loop.index }}&nbsp;&nbsp;
                    </td>
                    <td>
                        <pre>{{ query }}</pre>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endmacro %}
